home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / TreeModelListener.java < prev    next >
Text File  |  1998-06-30  |  3KB  |  82 lines

  1. /*
  2.  * @(#)TreeModelListener.java    1.6 97/07/18
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.event;
  22.  
  23. import java.util.EventListener;
  24.  
  25. /**
  26.  * TreeChangeListener defines the interface for an object that listens
  27.  * to changes in a TreeModel.
  28.  *
  29.  * @version 1.6 07/18/97
  30.  * @author Rob Davis
  31.  * @author Ray Ryan
  32.  */
  33. public interface TreeModelListener extends EventListener {
  34.  
  35.     /**
  36.      * <p>Invoked after a node (or a set of siblings) has changed in some
  37.      * way. The node(s) have not changed locations in the tree or
  38.      * altered their children arrays, but other attributes have
  39.      * changed and may affect presentation. Example: the name of a
  40.      * file has changed, but it is in the same location in the file
  41.      * system.</p>
  42.      * 
  43.      * <p>e.path() returns the path the parent of the changed node(s).</p>
  44.      * 
  45.      * <p>e.childIndices() returns the index(es) of the changed node(s).</p>
  46.      */
  47.     void treeNodesChanged(TreeModelEvent e);
  48.  
  49.     /**
  50.      * <p>Invoked after nodes have been inserted into the tree.</p>
  51.      * 
  52.      * <p>e.path() returns the parent of the new nodes
  53.      * <p>e.childIndices() returns the indices of the new nodes in
  54.      * ascending order.
  55.      */
  56.     void treeNodesInserted(TreeModelEvent e);
  57.  
  58.     /**
  59.      * <p>Invoked after nodes have been removed from the tree.  Note that
  60.      * if a subtree is removed from the tree, this method may only be
  61.      * invoked once for the root of the removed subtree, not once for
  62.      * each individual set of siblings removed.</p>
  63.      *
  64.      * <p>e.path() returns the former parent of the deleted nodes.</p>
  65.      * 
  66.      * <p>e.childIndices() returns the indices the nodes had before they were deleted in ascending order.</p>
  67.      */
  68.     void treeNodesRemoved(TreeModelEvent e);
  69.  
  70.     /**
  71.      * <p>Invoked after the tree has drastically changed structure from a
  72.      * given node down.  If the path returned by e.getPath() is of length
  73.      * one and the first element does not identify the current root node
  74.      * the first element should become the new root of the tree.<p>
  75.      * 
  76.      * <p>e.path() holds the path to the node.</p>
  77.      * <p>e.childIndices() returns null.</p>
  78.      */
  79.     void treeStructureChanged(TreeModelEvent e);
  80.  
  81. }
  82.